package com.tank.bean.item;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.tank.bean.School;
import com.tank.bean.product.Offer;
import com.tank.bean.product.ParentType;
import com.tank.bean.product.SonType;


@Entity
@DiscriminatorValue("product")
public class Product extends Item {
	//id				id			物品编号
	//tltle				name		物品名称
	//content			description 物品描述
	//author			user		所属用户
	//favourCount		likenum		被赞的次数
	//transpondCount	sharenum	被分享的次数
	//commentCount					被评论的次数
	//pubtime			extdate		添加时间
	//images						物品图片           [onetomany]
	
	private Double price;//物品价格
	private String wantTitle;//需求物品名称
	private String wantDescription;//需求物品描述 
	private Integer extendType; //交换方式(0：现金交易；1：网上付款；2：银行转账；3：其他）
	private Date extendTime;//交换时间
	private String extendAddress;//交换地点
	private Integer isPost;//是否邮寄（1：是；0否）
	private String postAddress;//收件地址
	
	@OneToMany(cascade={CascadeType.ALL}, mappedBy ="product")
	private List<Offer> offer;//本物品的交换意愿
	private Integer viewCount;//被关注的次数
	
	@ManyToOne
	private ParentType parentType;//所属大类
	@ManyToOne
	private SonType sonType;//所属小类
	
	private Integer stauts;//物品状态【根据状态，可能要加载一些相关的东西】
	
	@ManyToOne
	private School school;//物品所属学校【放便按学校展示物品】


	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getWantTitle() {
		return wantTitle;
	}

	public void setWantTitle(String wantTitle) {
		this.wantTitle = wantTitle;
	}

	public String getWantDescription() {
		return wantDescription;
	}

	public void setWantDescription(String wantDescription) {
		this.wantDescription = wantDescription;
	}

	public List<Offer> getOffer() {
		return offer;
	}

	public void setOffer(List<Offer> offer) {
		this.offer = offer;
	}

	public Integer getViewCount() {
		return viewCount;
	}

	public void setViewCount(Integer viewCount) {
		this.viewCount = viewCount;
	}

	public ParentType getParentType() {
		return parentType;
	}

	public void setParentType(ParentType parentType) {
		this.parentType = parentType;
	}

	public SonType getSonType() {
		return sonType;
	}

	public void setSonType(SonType sonType) {
		this.sonType = sonType;
	}

	public Integer getStauts() {
		return stauts;
	}

	public void setStauts(Integer stauts) {
		this.stauts = stauts;
	}

	public School getSchool() {
		return school;
	}

	public void setSchool(School school) {
		this.school = school;
	}

	public Integer getExtendType() {
		return extendType;
	}

	public void setExtendType(Integer extendType) {
		this.extendType = extendType;
	}

	public Date getExtendTime() {
		return extendTime;
	}

	public void setExtendTime(Date extendTime) {
		this.extendTime = extendTime;
	}

	public String getExtendAddress() {
		return extendAddress;
	}

	public void setExtendAddress(String extendAddress) {
		this.extendAddress = extendAddress;
	}

	public Integer getIsPost() {
		return isPost;
	}

	public void setIsPost(Integer isPost) {
		this.isPost = isPost;
	}

	public String getPostAddress() {
		return postAddress;
	}

	public void setPostAddress(String postAddress) {
		this.postAddress = postAddress;
	}
	
	
}
